<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>
</head>
<body>
    <div id="app">
        <label for="" v-for="(item,index) in hobbyList" :key="index" > <input type="checkbox" @change="select(item)">{{item}}</label>
        <ul>
            <li v-for="(item,index) in list" :key="index">{{item}}</li>
        </ul>
    </div>
    <script>
        const app = new Vue({
            el:'#app',
            data:{
                hobbyList: ["科幻", "喜剧", "动漫", "冒险", "科技", "军事", "娱乐", "奇闻"],
                list:[]
            },
            methods:{
                select(item) {
                    this.list.push(item)
                }
            }
        })
    </script>
</body>
</html>